package com.frx.extra.compare;

import java.util.Arrays;

/**
 * Created by xurenfeng on 2019/2/15.
 *
 */
public class CompareTest {

    public static void main(String[] args){

        Student[] student = {new Student("aa",11),new Student("bb",10)};
        System.out.println("排序前:");
        for (Student s : student){
            System.out.print(s.getName() + " ");
        }
        System.out.println();
        Arrays.sort(student,new StudentComparator());
        System.out.println("排序后:");
        for (Student s : student){
            System.out.print(s.getName() + " ");
        }
    }

}
